package com.ruoyi.message.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.message.mapper.GroupMessageMapper;
import com.ruoyi.message.domain.GroupMessage;
import com.ruoyi.message.service.IGroupMessageService;

/**
 * 群消息记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-19
 */
@Service
public class GroupMessageServiceImpl implements IGroupMessageService 
{
    @Autowired
    private GroupMessageMapper groupMessageMapper;

    /**
     * 查询群消息记录
     * 
     * @param id 群消息记录主键
     * @return 群消息记录
     */
    @Override
    public  List<GroupMessage> selectGroupMessageById(Long id)
    {
        return groupMessageMapper.selectGroupMessageById(id);
    }

    /**
     * 查询群消息记录列表
     * 
     * @param groupMessage 群消息记录
     * @return 群消息记录
     */
    @Override
    public List<GroupMessage> selectGroupMessageList(GroupMessage groupMessage)
    {
        return groupMessageMapper.selectGroupMessageList(groupMessage);
    }

    /**
     * 新增群消息记录
     * 
     * @param groupMessage 群消息记录
     * @return 结果
     */
    @Override
    public int insertGroupMessage(GroupMessage groupMessage)
    {
        groupMessage.setCreateTime(DateUtils.getNowDate());
        return groupMessageMapper.insertGroupMessage(groupMessage);
    }

    /**
     * 修改群消息记录
     * 
     * @param groupMessage 群消息记录
     * @return 结果
     */
    @Override
    public int updateGroupMessage(GroupMessage groupMessage)
    {
        return groupMessageMapper.updateGroupMessage(groupMessage);
    }

    /**
     * 批量删除群消息记录
     * 
     * @param ids 需要删除的群消息记录主键
     * @return 结果
     */
    @Override
    public int deleteGroupMessageByIds(Long[] ids)
    {
        return groupMessageMapper.deleteGroupMessageByIds(ids);
    }

    /**
     * 删除群消息记录信息
     * 
     * @param id 群消息记录主键
     * @return 结果
     */
    @Override
    public int deleteGroupMessageById(Long id)
    {
        return groupMessageMapper.deleteGroupMessageById(id);
    }
}
